Skip to content
This repository was archived by the owner on Feb 28, 2026. It is now read-only.

Use set for efficient retry status code filtering#266

Closed
Stephen0512 wants to merge 1 commit intoAzure:masterfrom
Stephen0512:master
Closed

Use set for efficient retry status code filtering#266
Stephen0512 wants to merge 1 commit intoAzure:masterfrom
Stephen0512:master

Conversation

@Stephen0512
Copy link

This PR improves the implementation of ClientRetryPolicy by replacing list-based membership checks with a set when computing retryable HTTP status codes.

Previously, the retry status code list was generated by checking membership against a list of safe status codes, resulting in repeated O(n) lookups for 999 times. This change introduces a set for the safe status codes, enabling O(1) average-time membership checks while preserving the existing behavior and semantics.

The issue was identified during an ongoing research project.

@lmazuel
Copy link
Member

lmazuel commented Feb 28, 2026

Hello, this project is now deprecated and no longer accept PR and releases. If you encounter any issues using the Azure SDK for Python, please file an issue on https://github.com/Azure/azure-sdk-for-python/issues
Thanks!

@lmazuel lmazuel closed this Feb 28, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants